﻿@using WB.Core.BoundedContexts.Headquarters.Invitations
@model WB.Core.BoundedContexts.Headquarters.Invitations.EmailParams
@inject IWebInterviewLinkProvider webInterviewLinkProvider
@{
    Uri webRoot = new Uri((string) ViewData["webRoot"]);
}
@{ Layout = null; }

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>@Model.Subject</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style type="text/css">
        ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        ul li {
            margin: 0;
            padding: 0;
            display: inline-block;
        }

        ul li a:hover {
            text-decoration: underline !important;
        }

        table {
            border-spacing: 0;
        }

        th, td {
            display: block;
        }

        img {
            border: 0; /* 1 */
            -ms-interpolation-mode: bicubic; /* 2 */
        }

        button {
            font-size: 100%; /* 1 */
            margin: 0; /* 2 */
            vertical-align: baseline; /* 3 */
            vertical-align: middle; /* 3 */
            line-height: normal;
        }

        .btn-success:hover {
            background: #2c7613 !important;
            border-color: #2c7613 !important;
        }
    </style>
</head>
<body style="margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; box-sizing: border-box;">
    <table class="em-table" align="center" border="0" cellspacing="0" cellpadding="0" style="max-width: 600px; background-image: url('@("~/img/logo.svg".Replace("~", ViewData["webAppRoot"]?.ToString()))'); background-repeat: no-repeat;  background-size: 270px auto;  background-position: 115% 45px;">
        <tr>
            <td style="border: 6px solid #E5E5E5;  padding: 50px 55px 115px; box-sizing: border-box;">
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="padding-bottom: 80px;">
                            <img src="@(webRoot + "/api/CompanyLogo/ThumbnailOrDefault")" alt="logo" style="display: block; max-height: 170px; width: auto" class="em-img" />
                        </td>
                    </tr>
                    <tr>
                        <td style="font-size: 24px; line-height: 30px; color: #727272; font-weight: bold; white-space: pre-wrap;">@Model.Subject</td>
                    </tr>
                    <tr>
                        <td style="padding: 40px 0; font-size: 16px; line-height: 20px; white-space: pre-wrap;">@Html.Raw(Model.MainText)</td>
                    </tr>
                    @if (!string.IsNullOrWhiteSpace(Model.Password))
                    {
                        <tr>
                            <td style="padding: 0px 0 5px; font-size: 16px; line-height: 20px; white-space: pre-wrap;">@Model.PasswordDescription</td>
                        </tr>
                        <tr>
                            <td style="padding: 0px 0 50px; font-size: 24px; line-height: 30px; color: #727272; font-weight: bold;">
                                @Model.Password
                            </td>
                        </tr>
                    }
                    @if (!string.IsNullOrWhiteSpace(Model.Link))
                    {
                        <tr>
                            <td>
                                <a href="@Model.Link" class="btn-success"
                                   style="text-decoration: none; background: #368E19; padding: 10px 12px; text-transform: uppercase; letter-spacing: 0.1em; border-radius: 4px; border: 2px solid #368E19; color: #fff; font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 14px; box-shadow: none;">@Model.LinkText</a>
                            </td>
                        </tr>
                    }
                </table>
            </td>
        </tr>
        <tr>
            <td width="100%" align="center">
                <table align="center" width="80%" cellpadding="0" cellspacing="0" border="0" style="color: #808080;">
                    <tr>
                        <td align="center" style="padding: 15px 0;">
                            <ul>
                                @if (Model.Id != null)
                                {
                                    <li><a href="@webInterviewLinkProvider.GetViewInBrowserLink(Model.Id)" style="color: #808080; text-decoration: none; padding: 0 10px;">View email in browser</a></li>
                                }
                            </ul>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" style="padding: 15px 0; white-space: pre-wrap;">@Model.SenderName. @Model.Address</td>
                    </tr>
                    <tr>
                        <td align="center" style="padding-top: 135px;">Powered by <a href="https://mysurvey.solutions/">Survey Solutions</a></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
